﻿@using WebEntities
@using com.subb.Tools.Pager

@model PagedList<PP_Product>

@{
    ViewBag.Title = "Search";
    Layout = "~/Areas/EN/Views/Shared/_EnDefLayout.cshtml";
}

<div class="topadimg"><img src="/Images/banner03.jpg" /></div>
<div class="subleft">
    <h2>
        <img src="/Images/subicon02.jpg" alt="" />
        <span>Catalogue</span>
    </h2>
    @Html.Action("LeftMenu", new { cataId = 0 })
</div>
<div class="subright">
    <div class="pagepath"><a href="/en"><img src="/Images/homeicon.jpg" alt="首页" /></a> &gt; <a href="/en/products">Product Center</a> &gt; <span>Search</span></div>
    <div class="midcontent">
        <div class="prod_searesult">
            <div class="searesultxt">Search result：Total of <b>@ViewBag.SearchCount</b> products found.</div>
            <div class="seabar">
                @using (Html.BeginForm("search", "products", FormMethod.Post, new { id = "form1" }))
                {
                    @Html.TextBox("seakey", (string)ViewBag.SearchKey, new { @class = "seachtext" })
                    <img src="/Images/searchbtn.jpg" alt="" id="searchbtn" />
                }
            </div>
            <div class="cls"></div>
        </div>
        <ul class="prodlist">
            @foreach (var product in Model)
            {
                <li>
                    <a href="/products/details/@product.ProductID" target="_blank">
                        <div class="prod_idximg"><img src="@product.ProductCover" alt="@product.ProductName" /></div>
                        <div style="padding-top:5px">@product.ProductName</div>
                    </a>
                </li>
            }
        </ul>
        <div class="cls"></div>
        @Html.Pager(Model, new PagerOptions
        {
           PageIndexParameterName = "page",
           CurrentPagerItemWrapperFormatString = "<span class=\"currpage\">{0}</span>", 
                NumericPagerItemWrapperFormatString = "<span class=\"pagenum\">{0}</span>", CssClass = "pager", SeparatorHtml = "" })
    </div>
</div>
<div class="cls"></div>
